CREATE TABLE [dbo].[tb_Reestructuras]
(
[IDReestructura] [int] NOT NULL IDENTITY(1, 1),
[Descripcion] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[FechaPedido] [datetime] NOT NULL,
[FechaVigencia] [datetime] NOT NULL,
[Estado] [int] NOT NULL CONSTRAINT [DF_tb_Reestructuras_Estado] DEFAULT ((12)),
[SaldoCargos] [int] NOT NULL CONSTRAINT [DF_tb_Reestructuras_SaldoCargos] DEFAULT ((0)),
[SaldoHoras] [int] NOT NULL CONSTRAINT [DF_tb_Reestructuras_SaldoHoras] DEFAULT ((0)),
[SaldoPuntos] [int] NOT NULL CONSTRAINT [DF_tb_Reestructuras_SaldoPuntos] DEFAULT ((0)),
[SaldoAbrir] [int] NOT NULL CONSTRAINT [DF_tb_Reestructuras_SaldoAbrir] DEFAULT ((0)),
[SaldoCerrar] [int] NOT NULL CONSTRAINT [DF_tb_Reestructuras_SaldoCerrar] DEFAULT ((0)),
[HorasAbrir] [int] NOT NULL CONSTRAINT [DF_tb_Reestructuras_HorasAbrir] DEFAULT ((0)),
[HorasCerrar] [int] NOT NULL CONSTRAINT [DF_tb_Reestructuras_HorasCerrar] DEFAULT ((0)),
[PuntosCerrar] [int] NOT NULL CONSTRAINT [DF_tb_Reestructuras_PuntosCerrar] DEFAULT ((0)),
[PuntosAbrir] [int] NOT NULL CONSTRAINT [DF_tb_Reestructuras_PuntosAbrir] DEFAULT ((0)),
[Responsable] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL,
[AprobEdu] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[AprobEco] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL,
[CargoAbrir] [int] NOT NULL CONSTRAINT [DF_tb_Reestructuras_CargoAbrir] DEFAULT ((0)),
[CargoCerrar] [int] NOT NULL CONSTRAINT [DF_tb_Reestructuras_CargoCerrar] DEFAULT ((0))
) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_Reestructuras] ADD CONSTRAINT [PK_tb_Reestructuras] PRIMARY KEY NONCLUSTERED  ([IDReestructura]) ON [PRIMARY]
GO
ALTER TABLE [dbo].[tb_Reestructuras] WITH NOCHECK ADD CONSTRAINT [FK_tb_Reestructuras_tb_EstadosDeReestructura] FOREIGN KEY ([Estado]) REFERENCES [dbo].[tb_EstadosDeReestructura] ([idEstadoReestructura])
GO
ALTER TABLE [dbo].[tb_Reestructuras] ADD CONSTRAINT [FK_tbReestructuras_tbEstadosDeReestructura] FOREIGN KEY ([Estado]) REFERENCES [dbo].[tb_EstadosDeReestructura] ([idEstadoReestructura])
GO
ALTER TABLE [dbo].[tb_Reestructuras] NOCHECK CONSTRAINT [FK_tb_Reestructuras_tb_EstadosDeReestructura]
GO
